package com.saibo.spider.commons;

import java.util.HashMap;
import java.util.Map;

import com.saibo.spider.utils.IpConfigUtils;
import com.saibo.spider.utils.StringUtil;

public class RegisterCommons {
	
	public static void main(String[] args) {
		System.out.println(new RegisterCommons().registerCrawlerPoint());
	}
	
	/**
	 * 向站点提交注册申请
	 * @return
	 */
	public int registerCrawlerPoint(){
		String macAddr = IpConfigUtils.getMACAddress();
		String ipAddr = IpConfigUtils.getNetIPAddress();
		Map<String,Object> requestParam = new HashMap<String,Object>();
		requestParam.put("macaddr", macAddr);
		requestParam.put("ipaddr", ipAddr);
		String stat = ConnectServer.sendPostRequest("",StringUtil.mapToJson(requestParam));
		System.out.println("响应状态:"+stat);
		return 0;
	}
}
